package com.dldata.devtools30.repository.zhibiao;



import com.dldata.devtools30.entity.DevtZbobjInfoEntity;
import com.dldata.devtools30.entity.DevtZbobjInfoEntity;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.jpa.repository.Query;
import org.springframework.stereotype.Repository;

import java.util.Collection;
import java.util.List;
import java.util.Set;

/**
 * Created by ai on 2017/1/11.
 */
@Repository
public interface DevtZbobjInfoEntityDao
        extends com.dldata.devtools30.repository.BaseRepository<DevtZbobjInfoEntity,String>, JpaSpecificationExecutor<DevtZbobjInfoEntity> {
    
    @Query("select t from DevtZbobjInfoEntity t ")
    public List<DevtZbobjInfoEntity> getAll();
    
    @Query("select t from DevtZbobjInfoEntity t where t.zbobjname like  ?1 or zbobjcode like ?1 ")
    public List<DevtZbobjInfoEntity> getAll(String serach);
    
    @Query("select t from DevtZbobjInfoEntity t where t.id in(?1) " +
            " and t.id not in ( select tz.zbobjid from  DevtZbplanZbobjEntity tz where tz.planid=?2 ) ")
    public List<DevtZbobjInfoEntity> getAllByIdListAndNoPlanid(Collection<String> zbobjIdList, String planId );
    
    @Query("select t from DevtZbobjInfoEntity t where t.id in(?1) ")
    public List<DevtZbobjInfoEntity> getAllByIdList(Collection<String> zbobjIdList);
    
}
